/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vista;

import javax.swing.ImageIcon;
import org.jvnet.substance.SubstanceLookAndFeel;

/**
 *
 * @author ArandiLopez
 */
public class InicioVista extends javax.swing.JFrame {

    //Variables
    String tipo;

    /**
     * Creates new form InicioVista
     */
    public InicioVista() {
        initComponents();
        this.setIconImage(new ImageIcon("P.png").getImage());
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        aleatorioBtn = new javax.swing.JButton();
        predefinidoBtn = new javax.swing.JButton();
        aboutBtn = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Bienvenido!!");
        setResizable(false);

        jLabel1.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
        jLabel1.setText("Recorrido de un Laberinto");

        jLabel2.setFont(new java.awt.Font("Cantarell", 1, 24)); // NOI18N
        jLabel2.setText("Escoja una opcion para empezar!!");

        aleatorioBtn.setText("Laberinto Aleatorio");
        aleatorioBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aleatorioBtnActionPerformed(evt);
            }
        });

        predefinidoBtn.setText("Laberinto Predefinido");
        predefinidoBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                predefinidoBtnActionPerformed(evt);
            }
        });

        aboutBtn.setText("About");
        aboutBtn.setToolTipText("Licencia del Juego");
        aboutBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aboutBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(138, 138, 138)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(95, 95, 95)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(aleatorioBtn)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(predefinidoBtn))
                            .addComponent(jLabel2)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(248, 248, 248)
                        .addComponent(aboutBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(97, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jLabel2)
                .addGap(40, 40, 40)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aleatorioBtn)
                    .addComponent(predefinidoBtn))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                .addComponent(aboutBtn)
                .addGap(20, 20, 20))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void aleatorioBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aleatorioBtnActionPerformed
        // TODO add your handling code here:
        tipo = "aleatorio";
        LaberintoVista laberintoVista = new LaberintoVista(this, false, tipo);
        laberintoVista.setTitle("Laberinto Aleatorio");
        laberintoVista.setVisible(true);
    }//GEN-LAST:event_aleatorioBtnActionPerformed

    private void aboutBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutBtnActionPerformed
        // TODO add your handling code here:
        Licencia licencia = new Licencia(this, true);
        licencia.setVisible(true);
    }//GEN-LAST:event_aboutBtnActionPerformed

    private void predefinidoBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_predefinidoBtnActionPerformed
        // TODO add your handling code here:
        tipo = "predefinido";
        LaberintoVista laberintoVista = new LaberintoVista(this, false, tipo);
        laberintoVista.setTitle("Laberinto Predefinido");
        laberintoVista.setVisible(true);
    }//GEN-LAST:event_predefinidoBtnActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.FieldOfWheatSkin");

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new InicioVista().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton aboutBtn;
    private javax.swing.JButton aleatorioBtn;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JButton predefinidoBtn;
    // End of variables declaration//GEN-END:variables
}
